package com.yidu.BusinessData.mapper;


import com.yidu.BusinessData.entity.SecurityEntity;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;
/**@description: 证券信息Mapper
 *@author: 肖理
 *@create: 2022-09-10
 **/
@Repository
public interface SecurityMapper {
        @Insert("insert into security value (#{securityId},#{securityName},#{securitType},#{stockId},#{releaseDate},#{delayDate},#{exchangeName},#{securityBeiiZhu})")
        int securityInsert(SecurityEntity securityEntity);
        @Select("select * from security sy join stock sk on sy.stockId = sk.stockId where securityName like CONCAT('%',#{securityName},'%') limit #{page},#{limit} ")
        List<SecurityEntity> securitySelect(Map map);
        @Select("select count(*) from security where securityName like CONCAT('%',#{securityName},'%')")
        int securitySelecttwo(String securityName);
        @Delete("delete from security where securityId=#{securityId}")
        int securityDelete(String securityId);
        @Update("update security set securityName=#{securityName},securitType=#{securitType},stockId=#{stockId},releaseDate=#{releaseDate},delayDate=#{delayDate},exchangeName=#{exchangeName},securityBeiiZhu=#{securityBeiiZhu} where securityId=#{securityId}")
        int securityUpdate(SecurityEntity securityEntity);
}
